package com.hxkj.cst.chengshuitong.ui.fragment

import android.support.v7.widget.LinearLayoutManager
import android.view.View
import com.hxkj.cst.chengshuitong.OrderBean
import com.hxkj.cst.chengshuitong.R
import com.hxkj.cst.chengshuitong.base.BaseFragment
import com.hxkj.cst.chengshuitong.ui.adapter.OrderRecyclerItemAdapter
import kotlinx.android.synthetic.main.fragment_order.view.*

/**
 * 作者： Luoyang on 2017/5/25.
 * 描述：
 */
class OrderFragment : BaseFragment() {
    override fun provideContentView(): Int = R.layout.fragment_order

    override fun initLayout(view: View) {
        initTestData()
        val layoutManager = LinearLayoutManager(activity)
        layoutManager.orientation = LinearLayoutManager.VERTICAL
        view.fo_rv_contain.layoutManager = layoutManager
        view.fo_rv_contain.adapter = OrderRecyclerItemAdapter(initTestData(), activity)
    }

    val dqlc = listOf("first", "second", "third", "fourth", 0, 1)

    fun initTestData(): ArrayList<OrderBean> {
        val orderBeans = ArrayList<OrderBean>()
        for (index in dqlc.indices) {
            orderBeans.add(OrderBean("测试车架号$index",
                    "测试操作时间$index",
                    "测试报税地址$index",
                    dqlc[index].toString(),
                    "未完成"))
        }
        return orderBeans
    }
}